//
//  CYEmptyCell.m
//  cyjf
//
//  Created by tauCross on 2017/5/9.
//  Copyright © 2017年 Auto Financing. All rights reserved.
//

#import "CYEmptyCell.h"



@implementation CYEmptyCellObject

@end



@interface CYEmptyCell ()

@end


@implementation CYEmptyCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if(self)
    {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        self.backgroundColor = [UIColor clearColor];
        self.contentView.backgroundColor = [UIColor clearColor];
    }
    return self;
}

+ (CGFloat)heightForObject:(CYEmptyCellObject *)object atIndexPath:(NSIndexPath *)indexPath tableView:(UITableView *)tableView
{
    return object.height;
}

- (BOOL)shouldUpdateCellWithObject:(CYEmptyCellObject *)object
{
    self.backgroundColor = object.color ? object.color : [UIColor clearColor];
    
    [self setNeedsLayout];
    return YES;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
}

@end
